/*	Brian Kirkpatrick
	QuX test driver
	Begun 6/30/2010
*/

#include <stdio.h>
#include "stringTree.h"
#include "stringDict.h"
#include "quxResult.h"
#include "QuX.h"

int main(int numArgs, char* args[]) {
/*	// Test stringTree
	stringTree * head = new stringTree();
	stringTree * att = new stringTree("name");
	stringTree * val = new stringTree("Brian E. Kirkpatrick", TT_VALUE);
	stringTree * q1 = new stringTree("quote");
	stringTree * t1 = new stringTree("Beer is proof that God loves us and wants us to be happy", TT_TEXT);
	stringTree * q2 = new stringTree("quote");
	stringTree * t2 = new stringTree("Who's John Galt?", TT_TEXT);
	head->setValue("user");
	att->setType(TT_ATTRIBUTE);
	head->addChild(att);
	att->addChild(val);
	head->addChild(q1);
	q1->addChild(t1);
	head->addChild(q2);
	q2->addChild(t2);
	head->print();
	printf("\n");
	delete head;*/

/*	// Test stringDict
	stringDict * myDict = new stringDict();
	myDict->set("c", "from");
	myDict->set("e", "xml");
	myDict->set("f", "file");
	myDict->print(); printf("\n");
	myDict->set("a", "stuff");
	myDict->set("b", "selected");
	myDict->set("d", "an");
	myDict->set("a", "strings");
	myDict->print(); printf("\n");
	printf("Entry 'a' is in location %d\n", myDict->find("a"));
	printf("Entry #3 has key %s, value %s\n", myDict->getKey(2).c_str(), myDict->getValue(2).c_str());
	stringDict newDict = (*myDict);
	myDict->set("b", "brian");
	newDict.print(); printf("\n");
	printf("Entry 'a' has value %s\n", newDict["a"].c_str());
	printf("Entry 3 has value %s\n", newDict[2].c_str());*/

	// Test QuX!
	QuX * q = new QuX();
	q->open("input.xml");
	printf("Error: %s\n", q->getError().c_str());
	q->print();
	string qry = "SELECT name FROM user";
	q->query(qry).print();
	delete q;
	return 0;
}
